﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ItemGroup.aspx.cs" Inherits="Main_Inventory_ItemGroup"
    EnableEventValidation="false" %>

<%@ Register Src="~/User Controls/PageHeading.ascx" TagName="heading" TagPrefix="acc" %>
<%@ Register Src="~/User Controls/CommonControls.ascx" TagName="CommonControls" TagPrefix="MyControls" %>
<%@ Register Src="~/User Controls/Pager.ascx" TagPrefix="custom" TagName="Pager" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
    <link href="../../../Styles/accounts.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <div class="divmain">
        <acc:heading ID="header1" runat="server" HeadingText="Item Group" />
        <div style="text-align: center; width: 50%; margin-left: 22%; margin-right: 25%">
            <asp:Label ID="lblMsg" runat="server" Font-Bold="true" EnableViewState="false"></asp:Label>
        </div>
        <asp:Panel ID="PnlAddNew" runat="server" Visible="false">
            <table class="tablecontent" style="width: 50%; margin-left: 25%; margin-right: 25%;">
                <tr>
                    <td class="headtd" colspan="3">
                        Item Group
                    </td>
                </tr>
                <tr>
                    <td colspan="3" style="height:3px;">
                       &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="width: 5%;">&nbsp;</td>
                    <td style="width: 30%;">
                        <asp:Label ID="lbligname" runat="server" Text="Item Group Name"></asp:Label><span
                            style="color: Red;">*</span>
                    </td>
                    <td style="width: 65%;">
                        <asp:TextBox ID="txtigname" runat="server" CssClass="input" Width="177px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Enter Group Name"
                            ControlToValidate="txtigname" ValidationGroup="item"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td style="width: 5%;">&nbsp;</td>
                    <td style="width: 30%;">
                        <asp:Label ID="lblaname" runat="server" Text="Alternate Name"></asp:Label>
                    </td>
                    <td style="width: 65%;">
                        <asp:TextBox ID="txtaname" runat="server" CssClass="input" Width="177px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td style="width: 5%;">&nbsp;</td>
                    <td style="width: 30%;">
                        <asp:Label ID="lblpname" runat="server" Text="Parent Group"></asp:Label><span style="color: Red;">*</span>
                    </td>
                    <td style="width: 65%;">
                        <asp:DropDownList ID="ddlgroup" Width="180px" runat="server" CssClass="input">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td style="width: 5%;">&nbsp;</td>
                    <td style="width: 30%;">
                    </td>
                    <td style="width: 65%;">
                        <asp:Button ID="btnsave" runat="server" CssClass="button" Text="Save" OnClick="btnsave_Click"
                            ValidationGroup="item" />
                    </td>
                </tr>
            </table>
        </asp:Panel>
    </div>
    <asp:Panel ID="PnlView" runat="server" Visible="false">
        <div style="margin-left: 10%; margin-top: 10px; width: 80%">
            <div style="background-color:#EEEEEE;">
                <table style="width:100%;">
                    <tr>
                        <td style="width:25%;"><custom:Pager ID="custPager" runat="server" OnPageChanged="custPager_PageChanged" /></td>
                        <td style="width:20%;"><MyControls:CommonControls ID="CommonControls1" runat="server" GridviewControlId="griddetils" HideColumns="4" /></td>                        
                        <td style="width:10%;">Search</td>
                        <td style="width:10%;"><asp:TextBox ID="txtSearchItmGropup" runat="server" CssClass="input" Width="180px"></asp:TextBox></td>                                                
                        <td style="width:10%">
                            <asp:Button ID="btnSearch" Text="Search" OnClientClick="return CheckSearch();" runat="server" Width="80px" CssClass="button" />
                            <script type="text/javascript">
                                function CheckSearch() {

                                }
                            </script>
                        </td>
                    </tr>
                </table>
            </div>
            <div id="divprint" runat="server">
                <asp:GridView ID="griddetils" Width="100%" runat="server" AllowPaging="true" AutoGenerateColumns="False"
                    AlternatingRowStyle-CssClass="gridview_alternate" CssClass="gridview" DataKeyNames="id"
                    PageSize="20" OnRowCancelingEdit="griddetils_RowCancelingEdit" OnRowDataBound="griddetils_RowDataBound"
                    OnRowDeleting="griddetils_RowDeleting" OnRowEditing="griddetils_RowEditing" RowStyle-CssClass="gridviewitem"
                    PagerStyle-CssClass="pgr" OnRowUpdating="griddetils_RowUpdating" OnPageIndexChanging="griddetils_PageIndexChanging"
                    OnRowCreated="griddetils_RowCreated">
                    <Columns>
                        <asp:TemplateField ItemStyle-HorizontalAlign="Center" HeaderText="S.No.">
                            <ItemTemplate>
                                <%#Container.DataItemIndex+1%></ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="Item Group Name" DataField="NAME" />
                        <asp:BoundField HeaderText="Altername Name" DataField="ALTNAME" />
                        <%--<asp:BoundField HeaderText="Parent Group" DataField="PARENTGROUPNAME" />--%>
                        <asp:TemplateField HeaderText="Parent Group">
                            <ItemTemplate>
                                <asp:Label runat="server" ID="lblpname" Text='<%#Eval("PARENTGROUPNAME") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:DropDownList ID="ddlpname" runat="server">
                                </asp:DropDownList>
                                <asp:HiddenField ID="HFPrimary" runat="server" Value='<%#Eval("parentid")%>' />
                                <asp:HiddenField ID="HiddenField1" runat="server" Value='<%#Eval("id")%>' />
                            </EditItemTemplate>
                        </asp:TemplateField>
                        <asp:CommandField ShowEditButton="True" ButtonType="Image" CancelImageUrl="~/Menu/images/cancel.png"
                            EditImageUrl="~/Menu/images/Edit_user.png" HeaderText="EDIT" UpdateImageUrl="~/Menu/images/update.png">
                            <ControlStyle Width="15px" />
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:CommandField>
                        <%-- <asp:CommandField ShowDeleteButton="true" HeaderText="Delete" ButtonType="Image" DeleteImageUrl="~/Menu/images/cancel.png" >
                           <ControlStyle Width="15px" />
                            <ItemStyle HorizontalAlign="Center" />
                           </asp:CommandField>--%>
                    </Columns>
                    <PagerStyle HorizontalAlign="Right" />
                    <AlternatingRowStyle CssClass="gridview_alternate"></AlternatingRowStyle>
                </asp:GridView>
            </div>
        </div>
    </asp:Panel>
    </form>
</body>
</html>
